unit UnitModificarMedico;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  sqldb, UnitMainForm, UnitMedicos;

type

  { TFormModificarMedico }

  TFormModificarMedico = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    SQLQuery1: TSQLQuery;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end; 

var
  FormModificarMedico: TFormModificarMedico;

implementation

{$R *.lfm}

{ TFormModificarMedico }

procedure TFormModificarMedico.Button2Click(Sender: TObject);
begin
  Close();
end;

procedure TFormModificarMedico.Button1Click(Sender: TObject);
begin
  Edit1.Text := uppercase(Edit1.Text);

  SQLQuery1.SQL.Text := 'update medico set mdc_nombre = ''' + Edit1.Text + ''', mdc_matricula = '''
    + Edit2.Text + ''' where mdc_cdg = ' + Label3.Caption;

  SQLQuery1.ExecSQL;

  ShowMessage('Modificacion Exitosa');

  Close();
end;

end.

